package com.lzq.train.batch.controller;

import com.lzq.train.batch.feign.BusinessFeign;
import jakarta.annotation.Resource;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class TestController {

    private final static Logger LOG = LoggerFactory.getLogger(TestController.class);

    @Resource
    BusinessFeign businessFeign;

    @GetMapping("/test/hello")
    public String hello() {
        // 测试BusinessFeign 完成batch服务端调用business服务端
        String businessHello = businessFeign.hello();
        LOG.info("batch 调用 business 测试成功: {}", businessHello);
        return "Hello World! Batch!";
    }
}
